﻿using System.Web;
using Autofac;
using Microsoft.Web.WebSockets;

namespace WebSockets.WS
{
    public class WsHttpHandler : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {
            if (context.IsWebSocketRequest || context.IsWebSocketRequestUpgrading)
                context.AcceptWebSocketRequest(Global.DIContainer.Resolve<WsHandler>());
        }
        public bool IsReusable { get { return false; } }
    }
}